<template>
	<navigator hover-class="none" :url="'/pages/product_detial/product_detial?id='+product._id" :class="changeflg?'change':''">
		<image :src="product.images[0]" mode="aspectFill"></image>
		<view class="text-box">
			<view class="title">
				{{product.name}}
			</view>
			<text class="text">
				{{product.description}}
			</text>
		</view>
	</navigator>
</template>

<script>
	export default {
		name:"Product",
		props:{
			product:{
				name:{
					type:String,
					default:'某商品的标题'
				},
				images:{
					type:Array,
					default:['https://cdn.uviewui.com/uview/swiper/swiper1.png']
				},
				textarea:{
					type:String,
					default:'某商品的描述，这是一段描述文字'
				}
			},
			changeflg:{
				type:Boolean,
				default:false
			}
		},
		data() {
			return {
				
			};
		}
	}
</script>

<style scoped>
	navigator{
		width: 48.5%;
		margin-bottom: 20rpx;
		background-color: #fff;
		overflow: hidden;
		box-shadow: 0 0 4rpx rgba(0, 0, 0, 0.3);
		border-radius: 12rpx;
	}
	navigator.change{
		width: 100%;
		display: flex;
		justify-content: space-between;
	}
	.text-box{
		padding: 25rpx;
	}
	view.title{
		font-size: 28rpx;
		color: #333;
		font-weight: bold;
		margin-bottom: 15rpx;
	}
	text{
		font-size: 24rpx;
		color: #888;
		overflow: hidden;
		text-overflow: ellipsis;
		-webkit-line-clamp: 2;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		line-height: 35rpx;
	}
	uni-image{
		height: 300rpx;
		
	}
	navigator.change uni-image{
		width: 43%;
		height: 15vh;
		min-height: 220rpx;
	}
	navigator.change  .text-box{
		width: 50%;
	}
	navigator.change view.title{
		margin-bottom: 30rpx;
	}
	navigator.change text{
		-webkit-line-clamp: 3;
	}
</style>